package com.sina.interfaces.manage.config;

import com.sina.interfaces.core.util.Constant;
import com.sina.interfaces.config.DaoConfig;
import org.springframework.context.annotation.*;
import org.springframework.context.support.ResourceBundleMessageSource;

/**
 * created  on 16/08/2017.
 */
@Configuration
@Import({DaoConfig.class})
@ComponentScan(basePackages = {"com.sina.interfaces.config"})
public class ServiceConfig {

    @Bean
    public ResourceBundleMessageSource serviceLayerMessageSource() {
        ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
        resourceBundleMessageSource.setUseCodeAsDefaultMessage(true);
        resourceBundleMessageSource.setDefaultEncoding(Constant.UTF8);
        resourceBundleMessageSource.setBasename("i18n/service/messages");
        return resourceBundleMessageSource;
    }
}
